package com.jjm.entidades;

import java.util.ArrayList;

import javax.jdo.annotations.Extension;
import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import com.opensymphony.xwork2.ActionSupport;

@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class Empresa extends ActionSupport { 
	@PrimaryKey
    @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
    @Extension(vendorName="datanucleus", key="gae.encoded-pk", value="true")
    private String key; 
	
    @Persistent
    private String nombre;
    
    /** Descripcion larga de la empresa */
    @Persistent
    private String descripcion;

	@Persistent
    private String cif;

    @Persistent
    private String email;
    
    @Persistent
    private String password;
    
    @Persistent(defaultFetchGroup = "true")
    private Photo photo;
    
    public int getStatus() {
		return status;
	}

	public void setStatus(int status) {
		this.status = status;
	}

	@Persistent
    private ContactInfo contactInfo;
    
    /** 0 - inactivo //// 1 - Activo */
    @Persistent
    private int status;
    
    @Persistent(mappedBy = "empresa", defaultFetchGroup = "true")
    ArrayList<Oferta> ofertas;

    public void getKey(String key) {
		this.key = key;
	}

	public String getKey() {
		return key;
	}

	public String getNombre() {
		return nombre;
	}

	public void setNombre(String nombre) {
		this.nombre = nombre;
	}

	public String getCif() {
		return cif;
	}

	public void setCif(String cif) {
		this.cif = cif;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public Photo getPhoto() {
		return photo;
	}

	public void setPhoto(Photo photo) {
		this.photo = photo;
	}

	public ContactInfo getContactInfo() {
		return contactInfo;
	}

	public void setContactInfo(ContactInfo contactInfo) {
		this.contactInfo = contactInfo;
	}

	public ArrayList<Oferta> getOfertas() {
		return ofertas;
	}

	public void setOfertas(ArrayList<Oferta> ofertas) {
		this.ofertas = ofertas;
	}
    

    public String getDescripcion() {
		return descripcion;
	}

	public void setDescripcion(String descripcion) {
		this.descripcion = descripcion;
	}
    
}
